package suray.rgv.communication.util;

/**
 * 两栖车接口类型
 */
public enum SeerMessageType {
    SET_ERROR_TO_ROBOT("设置第三方 Error", 0x12C0,0x39D0),
    SET_DIGITAL_OUTPUT_TO_ROBOT("设置DO状态", 0x1771,0x3E81),
    CHECK_ROBOT_POSITION_INFO("查询机器人位置", 0x03EC,0x2AFC),
    CHECK_ROBOT_IO("查询机器人IO状态", 0x03F5,0x2B05),
    CHECK_ROBOT_CURRENT_TASK_STATUS("查询机器人当前的导航状态", 0x03FC,0x2B0C),
    CHECK_ROBOT_POSITION_STATE("查询机器人定位状态", 0x03FD,0x2B0D),
    CHECK_ROBOT_AUTHOR("查询当前控制权所有者", 0x0424,0x2B34),
    CHECK_ROBOT_INFO1("查询批量数据1", 0x044C,0x2B5C),
    CHECK_ROBOT_TASK("查询机器人任务状态", 0x456,0x2B66),
    CHECK_LOAD_MAPS("查询机器人载入的地图以及储存的地图", 0x0514,0x2C24),
    CALIBRATION_ROBOT("重定位", 0x07D2,0x2EE2),
    CONFIRM_ROBOT_POSITION("确认定位正确", 0x07D3,0x2EE3),
    OPEN_CIRCLE_MOVE("开环运动", 0x07DA,0x2EEA),
    CHANGE_MAP("切换载入的地图", 0x07E6,0x2EF6),
    STOP_ROUTE("暂停当前导航", 0x0BB9,0x32C9),
    CONTINUE_ROUTE("继续当前导航", 0x0BBA,0x32CA),
    CANCEL_ROUTE("取消当前导航", 0x0BBB,0x32CB),
    ROUTE("路径导航", 0x0BEB,0x32FB),
    GET_CURRENT_ROUTE("获取路径导航的路径", 0x0BED,0x32FD),
    TRANSLATION("平动", 0x0BEF,0x32FF),
    ROTATE("转动", 0x0BF0,0x3300),
    PALLET_ROTATE("托盘旋转", 0x0BF1,0x3301),
    CIRCLE_ROTATE("圆弧运动", 0x0BF2,0x3302),
    APPOINT_ROUTE("指定路径导航", 0x0BFA,0x330A),
    CANCEL_APPOINT_ROUTE("清除指定导航路径", 0x0BFB,0x330B),
    CHECK_ROBOT_TASK_STATUS("查询机器人任务链", 0x0C1D,0x332D),
    DO_ROBOT_PRE_TASK("执行预存任务链", 0x0C22,0x3332),
    LOCK_ROBOT("抢占控制权", 0x0FA5,0x36B5),
    RELEASE_ROBOT("释放控制权", 0x0FA6,0x36B6),
    CLEAR_ALL_ERROR("清除机器人当前所有报错", 0x0FA9,0x36B9),
    UP_LOAD_MAP("上传地图到机器人", 0x0FAA,0x36BA),
    DOWNLOAD_MAP("从机器人上下载地图", 0x0FAB,0x36BB),
    DELETE_MAP("删除机器人上的地图", 0x0FAC,0x36BC),
    ;

    String des;
    int send;
    int receive;

    SeerMessageType(String des, int send) {
        this.des = des;
        this.send = send;
    }

    SeerMessageType(String des, int send , int receive) {
        this.des = des;
        this.send = send;
        this.receive = receive;
    }

    public static SeerMessageType parseSendType(int sendType) {
        for (SeerMessageType smt : SeerMessageType.values()) {
            if (smt.send == sendType){
                return smt;
            }
        }
        return null;
    }


    public int getSendValue() {
        return send;
    }

    public int getReceiveValue() {
        return receive;
    }

    @Override
    public String toString() {
        return des;
    }
}
